//
// Created by madison on 2022/4/15.
//

#include <iostream>

using namespace std;


int main() {

    void fun1();
    fun1();

    void fun2();
    fun2();

    void fun3();
    fun3();

    void fun4();
    fun4();
    return 0;
}

void fun1() {
    int rows;

    cout << "输入行数: ";
    cin >> rows;

    for (int i = 1; i <= rows; ++i) {
        for (int j = 1; j <= i; ++j) {
            cout << "*";
        }
        cout << "\n";
    }
}

void fun2() {
    int rows;
    cout << "输入行数: ";
    cin >> rows;
    for (int i = 1; i <= rows; ++i) {
        for (int j = 1; j <= i; ++j) {
            cout << j << " ";
        }
        cout << "\n";
    }
}

void fun3() {
    char input, alphabet = 'A';
    cout << "输入最后一个大写字母: ";
    cin >> input;
    for (int i = 1; i <= (input - 'A' + 1); ++i) {
        for (int j = 1; j <= i; ++j) {
            cout << alphabet << " ";
        }
        ++alphabet;
        cout << endl;
    }
}

void fun4() {
    int rows;

    cout << "输入行数: ";
    cin >> rows;

    for (int i = rows; i >= 1; --i) {
        for (int j = 1; j <= i; ++j) {
            cout << "* ";
        }
        cout << endl;
    }
}